package net.synck.gcontact.test;

import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Text;

public class ContactEditorComposite3 extends Composite {

	private FormToolkit formToolkit = null;   //  @jve:decl-index=0:visual-constraint=""
	private Composite compositeForm = null;
	private Section sectionGeneral = null;
	private Section sectionContacts = null;
	private Composite compositeMasterDetails = null;
	public ContactEditorComposite3(Composite parent, int style) {
		super(parent, style);
		initialize();
	}

	private void initialize() {
		createCompositeForm();
		setSize(new Point(543, 361));
		setLayout(new GridLayout());
	}

	/**
	 * This method initializes formToolkit	
	 * 	
	 * @return org.eclipse.ui.forms.widgets.FormToolkit	
	 */
	private FormToolkit getFormToolkit() {
		if (formToolkit == null) {
			formToolkit = new FormToolkit(Display.getCurrent());
		}
		return formToolkit;
	}

	/**
	 * This method initializes compositeForm	
	 *
	 */
	private void createCompositeForm() {
		GridData gridData1 = new GridData();
		gridData1.horizontalAlignment = GridData.FILL;
		gridData1.grabExcessHorizontalSpace = true;
		gridData1.verticalAlignment = GridData.CENTER;
		compositeForm = getFormToolkit().createComposite(this);
		compositeForm.setLayout(new GridLayout());
		compositeForm.setLayoutData(gridData1);
		createSectionGeneral();
		createSectionContacts();
		createCompositeMasterDetails();
	}

	/**
	 * This method initializes sectionGeneral	
	 *
	 */
	private void createSectionGeneral() {
		GridData gridData = new GridData();
		gridData.horizontalAlignment = GridData.FILL;
		gridData.grabExcessHorizontalSpace = true;
		gridData.verticalAlignment = GridData.CENTER;
		sectionGeneral = getFormToolkit().createSection(
				compositeForm,
				ExpandableComposite.TWISTIE | Section.DESCRIPTION
						| ExpandableComposite.TITLE_BAR);
		sectionGeneral.setExpanded(true);
		sectionGeneral.setLayoutData(gridData);
		sectionGeneral.setText("General");
	}

	/**
	 * This method initializes sectionContacts	
	 *
	 */
	private void createSectionContacts() {
		GridData gridData2 = new GridData();
		gridData2.horizontalAlignment = GridData.FILL;
		gridData2.verticalAlignment = GridData.CENTER;
		sectionContacts = getFormToolkit().createSection(
				compositeForm,
				ExpandableComposite.TWISTIE | Section.DESCRIPTION
						| ExpandableComposite.TITLE_BAR);
		sectionContacts.setExpanded(true);
		sectionContacts.setLayoutData(gridData2);
		sectionContacts.setText("Contacts");
	}

	/**
	 * This method initializes compositeMasterDetails	
	 *
	 */
	private void createCompositeMasterDetails() {
		GridData gridData3 = new GridData();
		gridData3.horizontalAlignment = GridData.FILL;
		gridData3.grabExcessHorizontalSpace = true;
		gridData3.verticalAlignment = GridData.CENTER;
		compositeMasterDetails = getFormToolkit().createComposite(compositeForm);
		compositeMasterDetails.setLayout(new GridLayout());
		compositeMasterDetails.setLayoutData(gridData3);
		
	}

}  //  @jve:decl-index=0:visual-constraint="10,10"
